home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Softdisk Supreme
/
Softdisk Supreme.iso
/
pc
/
DSK Files
/
0-49
/
SD006b.dsk
/
THE.DUNGEON.OF.HTAM.bas
< prev
Wrap
BASIC Source File
|
2003-06-12
|
11KB
|
423 lines
100 CALL -936
110 PRINT "THE DUNGEON OF HTAM "
120 PRINT "APPLE 11 + "
140 PRINT
150 PRINT "AN EDUCATIONAL MATH DUNGEON"
160 GOSUB 440
170 GOSUB 440
180 CALL -936
190 DIM A(9,9,2)
200 PRINT "YOU WILL BE TELEPORTED TO . . . "
230 PRINT
240 MA = 0:CA = 0:G = 1000:M1 = 1:K = 0
250 PRINT "ENTER YOUR CHARACTERS NAME?"
260 INPUT A$
270 GOSUB 440
280 PRINT : PRINT "YOU CARRY 1000 GOLD PIECES WITH YOU"
290 PRINT : GOSUB 440: PRINT A$;". . . YOU ARE ON YOUR WAY"
300 GOSUB 440
310 GOSUB 480
320 CALL -936
330 PRINT "YOU HAVE ARIVED AT . . . . "
340 PRINT
350 PRINT "THE DUNGEON OF HTAM . . . LEVEL 2"
360 PRINT
370 PRINT "YOU WILL ENCOUNTER MONSTERS AND"
380 PRINT "THIEVES,AND GOLD . . . BUT WATCH"
390 PRINT "YOUR STEP . . . . . . . . . . ."
400 PRINT "TRAP DOORS CAN BE COSTLY . . . ."
410 FOR AB = 1 TO 4545
420 NEXT AB
430 GOTO 1010
440 REM DELAY
450 FOR Z2 = 1 TO 909
460 NEXT Z2
470 RETURN
480 REM SET UP TWO LEVEL DUNGEON
490 FOR X = 1 TO 8
500 FOR Y = 1 TO 8
510 FOR Z = 1 TO 2
520 A(X,Y,Z) = INT( RND(1) *7 +1)
530 NEXT Z
540 NEXT Y
550 NEXT X
560 REM TRAP DOOR #8, MIN-1, MAX-3
570 H = INT( RND(1) *3 +1)
580 FOR A = 1 TO 2
590 FOR N = 1 TO H
600 X = INT( RND(1) *8 +1)
610 Y = INT( RND(1) *8 +1)
620 A(X,Y,A) = 8
630 NEXT N
640 NEXT A
650 REM STAIRWAYS #9, MIN-3, MAX-6
660 S = INT( RND(1) *4 +1) +2
670 FOR A = 1 TO 2
680 FOR N = 1 TO S
690 X = INT( RND(1) *8 +1)
700 Y = INT( RND(1) *8 +1)
710 A(X,Y,A) = 9
720 NEXT N
730 NEXT A
740 RETURN
750 REM STAIRWAY
760 L1 = L1 -1
770 PRINT "YOU WALK UP THE STAIRWAY"
780 GOSUB 440
790 PRINT "THE ENCHANTED KEY . . . OPENS THE LOCK"
800 GOSUB 440
810 IF L1 = O THEN 870
820 MA = O:K = O:K4 = INT( RND(1) *4 +1) +4
830 PRINT :CB = CA +K4
840 PRINT "YOU ARE AT. . . . . LEVEL 1"
850 GOSUB 440: GOSUB 440
860 GOTO 1070
870 PRINT "YOU FOUND YOUR WAY . . . "
880 PRINT ". . . OUT OF THE DUNGEON OF HTAM"
890 PRINT
900 PRINT "YOU HAVE ACQUIRED ";G;" GOLD PIECES"
910 GOSUB 930
920 GOTO 1910
930 GG = +100: REM RATING
940 R = INT((GG *CA -7OOO +1)/M1)
950 PRINT
960 PRINT "GAME RATING IS";R
970 PRINT : IF G < = 0 THEN 4300
980 PRINT "YOU TOOK ";M1;"TURNS TO FIND YOUR WAY OUT,"
990 PRINT "AND ANSERED ";CA;"QUESTIONS CORRECTLY."
1000 RETURN
1010 REM SET UP FIRST MOVE
1020 C = INT( RND(1) *8 +1)
1030 D = INT( RND(1) *8 +1)
1040 A(C,D,2) = 1
1050 L1 = 2
1060 K4 = INT( RND(1) *4 +1) +4
1070 REM PLAYER MOVE ROUTINE
1080 CALL -936
1090 A = A(C,D,L1)
1100 GOSUB 440
1110 ON A GOSUB 2220,2280,2340,2340,2390,2700,2750,2800,3080
1120 PRINT
1130 IF G < = 0 THEN 1820
1140 PRINT A$;", WHAT IS YOUR ACTION OR MOVE?"
1150 PRINT
1160 PRINT "(N)ORTH, (E)AST, (S)OUTH, (W)EST"
1170 PRINT "(U)P, (M)AP, (G)OLD"
1180 INPUT M1$
1190 M1 = M1 +1: IF K = 0 AND M1 > = 140/L1 THEN 4210
1200 IF M1$ = "N" THEN 1290
1210 IF M1$ = "E" THEN 1340
1220 IF M1$ = "S" THEN 1390
1230 IF M1$ = "W" THEN 1440
1240 IF M1$ = "U" THEN 1490
1250 IF M1$ = "M" THEN 1610
1260 IF M1$ = "G" THEN 1670
1270 PRINT
1280 GOTO 1120
1290 REM NORTH MOVEMENT
1300 IF A = 7 THEN 1710
1310 IF (D -1) = 0 THEN 1980
1320 D = D -1
1330 GOTO 1070
1340 REM EAST MOVEMENT
1350 IF A = 6 THEN 1770
1360 IF (C +1) = 9 THEN 2030
1370 C = C +1
1380 GOTO 1070
1390 REM SOUTH MOVEMENT
1400 IF A = 7 THEN 1710
1410 IF (D +1) = 9 THEN 2050
1420 D = D +1
1430 GOTO 1070
1440 REM WEST MOVEMENT
1450 IF A = 6 THEN 1770
1460 IF (C -1) = 0 THEN 2070
1470 C = C -1
1480 GOTO 1070
1490 CALL -936: REM STAIRWAY UP
1500 IF A < >9 THEN 1580
1510 IF K = 1 THEN 750
1520 PRINT
1530 PRINT "YOU CANNOT GO UP THE STAIRWAY"
1540 PRINT "YOU DONT HAVE THE KEY"
1550 GOSUB 440
1560 PRINT
1570 GOTO 1120
1580 PRINT "YOU ARE NOT AT A STAAIRWAY"
1590 GOSUB 440
1600 GOTO 1120
1610 CALL -936: REM MAP
1620 IF MA = 1 THEN 2090
1630 PRINT "YOU DONT HAVE THE MAP"
1640 PRINT
1650 GOSUB 440
1660 GOTO 1120
1670 REM GOLD PIECES
1680 CALL -936: PRINT "YOU HAVE ";G;" GOLD PIECES WITH YOU"
1690 PRINT
1700 GOTO 1120
1710 REM EW CORRIDOR
1720 PRINT
1730 CALL -936: PRINT "YOU ARE IN THE EAST-WEST CORRIDOR"
1740 PRINT "YOU CAN ONLY GO EAST OR WEST"
1750 PRINT
1760 GOTO 1120
1770 REM NS CORRIDOR
1780 PRINT
1790 CALL -936: PRINT "YOU ARE IN A NORTH SOUTH CORRIDOR"
1800 PRINT "YOU CAN ONLY GO NORTH OR SOUTH"
1810 GOTO 1750
1820 REM GOLD ZERO
1830 GOSUB 440: GOSUB 440
1840 PRINT
1850 PRINT "YOU LOST ALL YOUR GOLD AND "
1860 PRINT " . . . UNABLE TO MEET THE DEMANDS OF"
1870 PRINT " . . . THE DUNGEON OF HTAM"
1880 PRINT : PRINT
1890 PRINT "BETTER LUCK NEXT TIME"
1900 GOSUB 930
1910 PRINT
1920 PRINT "ANOTHER GAME"
1930 PRINT "ENTER '1' YES '0' NO"
1940 INPUT AA
1950 IF AA < > THEN 1970
1960 CALL -936: GOTO 220
1970 END
1980 CALL -936: PRINT "YOU ARE AT THE NORTH WALL"
1990 PRINT "YOU CANNOT PASS THROUGH"
2000 PRINT
2010 PRINT "TRY ANOTHER DIRECTION"
2020 GOTO 1120
2030 CALL -936: PRINT "YOU ARE AT THE EAST WALL"
2040 GOTO 1990
2050 CALL -936: PRINT "YOU ARE AT THE SOUTH WALL"
2060 GOTO 1990
2070 CALL -936: PRINT "YOU ARE AT THE WEST WALL"
2080 GOTO 1990
2090 REM DISPLAY MAP
2100 PRINT "THE DUNGEON OF HTAM *** MAP LEVEL ";L1;"***"
2110 PRINT
2130 FOR Q = 1 TO 8
2140 FOR N = 1 TO 8
2150 IF C = N AND D = Q THEN PRINT "P1 ";: GOTO 2180
2160 S1 = A(N,Q,L1)
2170 ON S1 GOSUB 3120,3120,3140,3140,3160,3180,3200,3220,3230
2180 NEXT N
2190 PRINT
2200 NEXT Q
2210 GOTO 1120
2220 REM EMPTY ROOM
2230 PRINT
2240 PRINT "YOU ARE IN A COLD AND DARK"
2250 PRINT " . . . . . . EMPTY CHAMBER"
2260 PRINT
2270 RETURN
2280 REM EMPTY ROOM 2
2290 PRINT
2300 PRINT "YOU ARE IN A DAMP AND MISTY"
2310 PRINT ". . . . . . . EMPTY CHAMBER"
2320 PRINT
2330 RETURN
2340 CALL -936: GOSUB 4160
2350 M4 = INT( RND(1) *4 +1)
2360 ON M4 GOSUB 3250,3380,3550,3680
2370 PRINT
2380 RETURN
2390 CALL -936: PRINT "THERE IS A THIEF IN THIS CHAMBER"
2400 A(C,D,L1) = 2
2410 GOSUB 440
2420 G4 = INT( RND(1) *350/L1 +1)
2430 Y = INT( RND(1) *8 +1)
2440 IF Y < = 3 THEN 2610
2450 PRINT
2460 PRINT " . . . . . . . HE SURPRISES YOU"
2470 GOSUB 440
2480 PRINT "AS HE QUICKLY PASSES YOU HE"
2490 PRINT "SNATCHES . . .";G4;"GOLD PIECES": PRINT
2500 G = G -G4
2510 REM LOOK FOR MAP
2520 IF MA = 1 THEN RETURN
2530 MA = INT( RND(1) *4 +1): IF MA < = 2 THEN MA = 1
2540 IF MA = 1 THEN 2570
2550 RETURN
2560 GOSUB 440
2570 PRINT "YOU SEARCH THE CHAMBER AND"
2580 GOSUB 440
2590 PRINT "YOU . . . . . FIND A MAP"
2600 RETURN
2610 PRINT "YOU SURPRISED A THIEF . . . . "
2620 GOSUB 440
2630 PRINT "AS HE RUNS OUT HE DROPS. . . . "
2640 PRINT " . . . ";G4;" GOLD PIECES."
2650 PRINT "YOU PICK UP THE GOLD PIECES":G = G +G4
2660 PRINT : IF MA = 1 THEN RETURN
2670 MA = INT( RND(1) *4 +1): IF MA <2 THEN MA = 1
2680 IF MA = 1 THEN 2570
2690 RETURN
2700 CALL -936: REM NORTH SOUTH CORRIDOR
2710 PRINT
2720 GOSUB 4350: PRINT ". . . ENTER A NORTH-SOUTH CORRIDOR"
2730 PRINT : GOSUB 4330
2740 RETURN
2750 CALL -936: REM EAST WEST CORRIDOR
2760 PRINT
2770 GOSUB 4350: PRINT " . . . ENTER AN EAST WEST CORRIDOR"
2780 PRINT
2790 RETURN
2800 REM TRAP DOOR
2810 PRINT "YOU ACTIVATED . . . A TRAP DOOR"
2820 GOSUB 440
2830 TD = INT( RND(1) *4 +1)
2840 IF TD > = 3 THEN 2890
2850 PRINT
2860 PRINT "BUT . . . YOU CAUGHT YOURSELF"
2870 PRINT "FROM FALLING"
2880 RETURN
2890 IF L1 = 2 THEN 3000
2900 L1 -L1 +1: PRINT :K = 1
2910 PRINT "YOU FELL THROUGH TO LEVEL 2 . . . AND"
2920 G = 100
2930 GOSUB 440
2940 PRINT
2950 PRINT "YOU . . . . . . . . LOST"
2960 PRINT "MOST OF YOUR GOLD PIECES": PRINT
2970 PRINT "YOU HAVE . . ";G;" GOLD PIECES LEFT"
2980 PRINT "BUT . . . YOU STILL HAVE YOUR KEY"
2990 RETURN
3000 PRINT "YOU FELL INTO A DEEP . . .PIT"
3010 GOSUB 440
3020 PRINT "YOU'RE LUCKY . . . ."
3030 PRINT "YOU DIDN'T GET HURT"
3040 PRINT
3050 GOSUB 440
3060 PRINT "BUT IN CLIMBING OUT. . ."
3070 GOTO 4250
3080 PRINT "YOU ARE AT A STAIRWAY"
3090 PRINT ". . . . . . GOING UP"
3100 PRINT
3110 RETURN
3120 PRINT "0 ";
3130 RETURN
3140 PRINT "M ";
3150 RETURN
3160 PRINT "? ";
3170 RETURN
3180 PRINT "NS ";
3190 RETURN
3200 PRINT "EW ";
3210 RETURN
3220 GOTO 3160
3230 PRINT "UP ";
3240 RETURN
3250 REM ADD
3260 PRINT "HALT *** I AM DDA"
3270 GOSUB 3810
3280 GOSUB 3860
3290 PRINT X;" + ";Y;" = ";
3300 Z = X +Y
3310 INPUT A1
3320 IF A1 = Z THEN 3360
3330 REM LOOSE GOLD
3340 GOSUB 4020
3350 RETURN
3360 GOSUB 3920
3370 RETURN
3380 REM SUB
3390 PRINT "STOP *** I AM BUS"
3400 GOSUB 3810
3410 GOSUB 3860
3420 PRINT X;" - ";Y;" = ";
3430 Z = X -Y
3440 INPUT A1
3450 IF A1 = Z THEN 3480
3460 GOSUB 4020
3470 RETURN
3480 GOSUB 3920
3490 RETURN
3500 GOSUB 480
3510 H = 1:O = 9:W = 8
3520 B = O:E = 5:R = 14
3530 C = O:PR = O
3540 GOTO 1010
3550 REM MULT
3560 PRINT "HALT *** I AM LUM"
3570 GOSUB 3810
3580 GOSUB 3860
3590 PRINT X;" X ";Y;" = ";
3600 Z = X *Y
3610 INPUT A1
3620 IF A1 = Z THEN 3660
3630 REM LOOSE GOLD
3640 GOSUB 4020
3650 RETURN
3660 GOSUB 3920
3670 RETURN
3680 REM DIV
3690 PRINT "STOP *** I AM DIV"
3700 GOSUB 3810
3710 GOSUB 3860
3720 PRINT X *Y;" / ";Y;" = ";
3730 Z = X
3740 INPUT A1
3750 IF A1 = Z THEN 3790
3760 REM LOOSE GOLD
3770 GOSUB 4020
3780 RETURN
3790 GOSUB 3920
3800 RETURN
3810 PRINT
3820 PRINT "YOU MAY NOT PASS THROUGH UNTIL"
3830 PRINT "YOU ANSWER THIS MATH QUESTION"
3840 PRINT
3850 RETURN
3860 REM RANDOM ROUTINE
3870 Y = INT( RND(1) *30/L1 +1)
3880 X = INT( RND(1) *30/L1 +1)
3890 PRINT "WHAT IS . . ."
3900 GOSUB 440
3910 RETURN
3920 PRINT "CORRECT"
3930 G4 = INT( RND(1) *400/L1 +1) +25
3940 G = G +G4
3950 GOSUB 440
3960 PRINT "YOU WIN ";G4;" GOLD PIECES"
3970 A(C,D,L1) = 1
3980 CA = CA +1: IF K = 1 THEN RETURN
3990 IF CA = K4 THEN 4110
4000 IF L1 = 1 THEN 4230
4010 RETURN
4020 PRINT
4030 PRINT "INCORRECT"
4040 PRINT "THE CORRECT ANSWER IS ";Z
4050 PRINT
4060 G4 = INT( RND(1) *350/L1 +1)
4070 G = G -G4
4080 GOSUB 440
4090 PRINT "YOU LOOSE ";G4;" GOLD PIECES"
4100 RETURN
4110 GOSUB 440
4120 K = 1
4130 PRINT : PRINT "YOU HAVE FOUND THE ENCHANTED KEY . . "
4140 GOSUB 440
4150 RETURN
4160 PRINT "YOU DISTURBED A MONSTER IN THIS CHAMBER"
4170 GOSUB 440
4180 PRINT "AND HE SPEAKS . . . . . . . . . ": PRINT
4190 GOSUB 440
4200 RETURN
4210 GOSUB 4120
4220 GOTO 1220
4230 IF CA = CB THEN 4110
4240 RETURN
4250 G = 100: GOSUB 440: PRINT
4260 PRINT "YOU . . . . . DROPPED"
4270 PRINT "MOST OF YOUR GOLD PIECES"
4280 PRINT "YOU HAVE . .";G;" GOLD PIECES LEFT"
4290 RETURN
4300 PRINT "YOU ANSWERED ";CA;" QUESTIONS CORRECTLY"
4310 PRINT " . . . . .IN";M1;" TURNS."
4320 RETURN
4330 PRINT "THE DOOR CLOSES AND LOCKS BEHIND YOU": GOSUB 440
4340 RETURN
4350 PRINT "YOU OPENED A SECRET DOOR AND . . . .": GOSUB 440
4360 RETURN